<html>
<title>学生管理系统</title>
	<head>
		<meta charset="utf-8" />
		<style type=text/css>
    body{
        background-image:url(jrjm.jpg) ;
		background-size:cover;
	    background-attachment: fixed;
	    background-repeat:no-repeat;
        color:#ffc0cb;
          }  
		  div{
			text-align:center;
		  }
	 a{
			text-decoration:none;
			color:#ffc0cb;

		  }
	.sc1:hover{color:red;}
	ul{
		    width:900px;
            height:700px;
            border:1px solid #ffc0cb;
            box-sizing: border-box;
			list-style-type: none;
			margin-left:25%; 
	}	
	.yh{
		color:#F08080;
		margin-top:1%;
		padding-left:650px;
	}
	.fs{
		border-spacing:5px;
		margin-top:5%;
		padding-right:50px;
		text-align:center;
		width:900px;
	}
	 th{
		color:#000000;
	}
	.cx{
		padding-left:150px;
	}
.zpsc{
		padding-left:600px;
	}
    </style>
	</head>
	<body>
<div>
	<h1>成凡大学学生信息管理系统</h1>
</div>
		<ul>
		<li class="yh">当前用户：
		<?php
        session_start();
        if(isset($_SESSION['name'])){
        echo $_SESSION['name'];
        }else{
        echo "<script>alert('你无权访问本网页，请先登录');history.go(-1);</script>";
} 
      echo "<a href='quit.php?name=quit'>&nbsp;&nbsp;退出登录</a>";
?>	
		</li>
		<form method="post" action="" class="cx">
			请输入查询条件：<input type="text" name="tj" placeholder="请输入学生学号或者学生姓名">
			<input type="submit" value="查询" >
		</form>
		<b><a href="tjxx.php">添加学生信息</a></b>
	<b><a href="zpsc.php" class="zpsc">信息文件上传</a></b>
		<table class="fs">
		<tr height="30" align="center" bgcolor="FFC0CB" >
		<th>学号</th>
		<th>姓名</th>
		<th>性别</th>
		<th>班级</th>
		<th>专业</th>
		<th>联系电话</th>
		<th>家庭地址</th>
		<th>操作</th>
		<th>操作</th>
	 </tr>
		<?php
		 require 'conn.php';
		 if(isset($_POST['tj']))
		 {
		 $tj=$_POST['tj'];
		 $result=mysqli_query($link,"select * from xs where xh='$tj' || name like '%$tj%'" ); 
		 while($num=mysqli_fetch_assoc($result))

		 {
			echo '<tr>' ;
			echo '<td>'.$num['xh'].'</td>';
			echo '<td>'.$num['name'].'</td>';
			echo '<td>'.$num['xb'].'</td>';
			echo '<td>'.$num['bj'].'</td>';
			echo '<td>'.$num['zy'].'</td>';
			echo '<td>'.$num['dh'].'</td>';
			echo '<td>'.$num['jtdz'].'</td>';
			echo '<td><a href=xg.php?action=xg&xh='.$num['xh'].' class="sc1">修改</a></td>';
			echo '<td><a href=sc.php?action=del&xh='.$num['xh'].' class="sc1">删除</a></td>';
			echo '</tr>' ;		 }
		}

		?>
		</table>
		</ul>
    <?php include("bq.php"); ?>
	</body>
</html>
